import request from '@/router/axios';

export const getList = (current, size, params, offerId) => {
  return request({
    url: '/api/beetles-offer/creative-text/page',
    method: 'get',
    params: {
      ...params,
      current,
      size,
      offerId,
    }
  })
}

export const getDetail = (id) => {
  return request({
    url: '/api/beetles-offer/creative-text/detail',
    method: 'get',
    params: {
      id
    }
  })
}

export const remove = (ids) => {
  return request({
    url: '/api/beetles-offer/creative-text/remove',
    method: 'post',
    params: {
      ids,
    }
  })
}

export const add = (textList) => {
  debugger
  return request({
    url: '/api/beetles-offer/creative-text/save',
    method: 'post',
    data: textList
  })
}

export const update = (row) => {
  debugger
  return request({
    url: '/api/beetles-offer/creative-text/update',
    method: 'post',
    data: row
  })
}

export const importExcel = (data) =>{
  return request({
    url: '/api/beetles-offer/creative-text/import-excel',
    method: 'post',
    data: data,
  })
}

export const getCreateUser = () =>{
  return request({
    url: '/api/beetles-offer/creative-text/get_create_users',
    method: 'get',
  })
}

export const getAccountList = (offerId) =>{
  return request({
    url: '/api/beetles-business/account/get-all-tt-account',
    method: 'get',
    params: {
      offerId
    }
  })
}
